﻿using System;
using System.Collections.Generic;
using SharpSqlAnalyzer.nodes.mysql;
using SharpSqlAnalyzer.nodes.oracle;
using SharpSqlAnalyzer.util;

namespace SharpSqlAnalyzer.nodes
{
	// Token: 0x020002E5 RID: 741
	public class TFunctionCall : TParseTreeNode
	{
		// Token: 0x170005A4 RID: 1444
		// (get) Token: 0x060019AD RID: 6573 RVA: 0x0032C9AA File Offset: 0x0032ABAA
		// (set) Token: 0x060019AE RID: 6574 RVA: 0x0032C9B2 File Offset: 0x0032ABB2
		public TExpression CastOperand
		{
			get
			{
				return this._castOperand;
			}
			set
			{
				this._castOperand = value;
			}
		}

		// Token: 0x170005A5 RID: 1445
		// (get) Token: 0x060019AF RID: 6575 RVA: 0x0032C9BB File Offset: 0x0032ABBB
		// (set) Token: 0x060019B0 RID: 6576 RVA: 0x0032C9C3 File Offset: 0x0032ABC3
		public TExpression StringExpr
		{
			get
			{
				return this._stringExpr;
			}
			set
			{
				this._stringExpr = value;
			}
		}

		// Token: 0x170005A6 RID: 1446
		// (get) Token: 0x060019B1 RID: 6577 RVA: 0x0032C9CC File Offset: 0x0032ABCC
		// (set) Token: 0x060019B2 RID: 6578 RVA: 0x0032C9D4 File Offset: 0x0032ABD4
		public TExpression SeparatorExpr
		{
			get
			{
				return this._separatorExpr;
			}
			set
			{
				this._separatorExpr = value;
			}
		}

		// Token: 0x060019B3 RID: 6579 RVA: 0x0032C9DD File Offset: 0x0032ABDD
		public void setExtractXMLArg(TExpressionList l)
		{
			this.ExtractXMLArg = l;
		}

		// Token: 0x060019B4 RID: 6580 RVA: 0x0032C9E6 File Offset: 0x0032ABE6
		public void setSortClause(TOrderBy b)
		{
			this._sortClause = b;
		}

		// Token: 0x060019B5 RID: 6581 RVA: 0x0032C9EF File Offset: 0x0032ABEF
		public void setWindowDef(TWindowDef w)
		{
			this.WindowDef = w;
		}

		// Token: 0x060019B6 RID: 6582 RVA: 0x0032C9F8 File Offset: 0x0032ABF8
		public void setExpr3(TExpression e)
		{
			this.expr3 = e;
		}

		// Token: 0x060019B7 RID: 6583 RVA: 0x0032CA01 File Offset: 0x0032AC01
		public void setExpr2(TExpression e)
		{
			this.expr2 = e;
		}

		// Token: 0x060019B8 RID: 6584 RVA: 0x0032CA0A File Offset: 0x0032AC0A
		public void setTypename(TTypeName tn)
		{
			this.typename = tn;
		}

		// Token: 0x060019B9 RID: 6585 RVA: 0x0032CA13 File Offset: 0x0032AC13
		public void setTrimArgument(TTrimArgument ta)
		{
			this.trimArgument = ta;
		}

		// Token: 0x060019BA RID: 6586 RVA: 0x0032CA1C File Offset: 0x0032AC1C
		public void setExpr1(TExpression e)
		{
			this.Expr1 = e;
		}

		// Token: 0x060019BB RID: 6587 RVA: 0x0032CA25 File Offset: 0x0032AC25
		public void setExtract_time_token(TSourceToken st)
		{
			this.extract_time_token = st;
		}

		// Token: 0x060019BC RID: 6588 RVA: 0x0032CA2E File Offset: 0x0032AC2E
		public void setFuncType(int ft)
		{
			this.funcType = ft;
		}

		// Token: 0x060019BD RID: 6589 RVA: 0x0032CA37 File Offset: 0x0032AC37
		public void setAggregateType(EAggregateType at)
		{
			this._aggregateType = at;
		}

		// Token: 0x060019BE RID: 6590 RVA: 0x0032CA40 File Offset: 0x0032AC40
		public void setArgs(TExpressionList el)
		{
			this._arguments = el;
		}

		// Token: 0x060019BF RID: 6591 RVA: 0x0032CA49 File Offset: 0x0032AC49
		public void setAnalyticFunction(TAnalyticFunction af)
		{
			this._analyticFunction = af;
		}

		// Token: 0x170005A7 RID: 1447
		// (get) Token: 0x060019C1 RID: 6593 RVA: 0x0032CA5B File Offset: 0x0032AC5B
		// (set) Token: 0x060019C0 RID: 6592 RVA: 0x0032CA52 File Offset: 0x0032AC52
		public TExpression Parameter
		{
			get
			{
				return this._parameter;
			}
			set
			{
				this._parameter = value;
			}
		}

		// Token: 0x170005A8 RID: 1448
		// (get) Token: 0x060019C3 RID: 6595 RVA: 0x0032CA6C File Offset: 0x0032AC6C
		// (set) Token: 0x060019C2 RID: 6594 RVA: 0x0032CA63 File Offset: 0x0032AC63
		public TExpression Style
		{
			get
			{
				return this._style;
			}
			set
			{
				this._style = value;
			}
		}

		// Token: 0x170005A9 RID: 1449
		// (get) Token: 0x060019C5 RID: 6597 RVA: 0x0032CA7D File Offset: 0x0032AC7D
		// (set) Token: 0x060019C4 RID: 6596 RVA: 0x0032CA74 File Offset: 0x0032AC74
		public virtual TExpressionCallTarget CallTarget
		{
			get
			{
				return this._callTarget;
			}
			set
			{
				this._callTarget = value;
			}
		}

		// Token: 0x170005AA RID: 1450
		// (get) Token: 0x060019C7 RID: 6599 RVA: 0x0032CA8E File Offset: 0x0032AC8E
		// (set) Token: 0x060019C6 RID: 6598 RVA: 0x0032CA85 File Offset: 0x0032AC85
		public virtual TGroupConcatParam GroupConcatParam
		{
			get
			{
				return this._groupConcatParam;
			}
			set
			{
				this._groupConcatParam = value;
			}
		}

		// Token: 0x060019C8 RID: 6600 RVA: 0x0032CA98 File Offset: 0x0032AC98
		public static bool isBuiltIn(string pName, EDbVendor pDBVendor)
		{
			IList<string> availableDbVersions = functionChecker.getAvailableDbVersions(pDBVendor);
			return functionChecker.isBuiltInFunction(pName, pDBVendor, availableDbVersions[availableDbVersions.Count - 1]);
		}

		// Token: 0x060019C9 RID: 6601 RVA: 0x0032CAC4 File Offset: 0x0032ACC4
		public virtual bool isBuiltIn(EDbVendor pDBVendor)
		{
			if (this.isCheckedBuiltIn)
			{
				return this._isBuiltIn_Renamed;
			}
			IList<string> availableDbVersions = functionChecker.getAvailableDbVersions(pDBVendor);
			this._isBuiltIn_Renamed = functionChecker.isBuiltInFunction(this.functionName.ToString(), pDBVendor, availableDbVersions[availableDbVersions.Count - 1]);
			this.isCheckedBuiltIn = true;
			return this._isBuiltIn_Renamed;
		}

		// Token: 0x170005AB RID: 1451
		// (get) Token: 0x060019CB RID: 6603 RVA: 0x0032CB22 File Offset: 0x0032AD22
		// (set) Token: 0x060019CA RID: 6602 RVA: 0x0032CB19 File Offset: 0x0032AD19
		public virtual TXMLPassingClause PassingClause
		{
			get
			{
				return this._passingClause;
			}
			set
			{
				this._passingClause = value;
			}
		}

		// Token: 0x170005AC RID: 1452
		// (get) Token: 0x060019CD RID: 6605 RVA: 0x0032CB33 File Offset: 0x0032AD33
		// (set) Token: 0x060019CC RID: 6604 RVA: 0x0032CB2A File Offset: 0x0032AD2A
		public virtual EAggregateType AggregateType
		{
			get
			{
				return this._aggregateType;
			}
			set
			{
				this._aggregateType = value;
			}
		}

		// Token: 0x170005AD RID: 1453
		// (get) Token: 0x060019CF RID: 6607 RVA: 0x0032CB44 File Offset: 0x0032AD44
		// (set) Token: 0x060019CE RID: 6606 RVA: 0x0032CB3B File Offset: 0x0032AD3B
		public virtual TOrderByItemList OrderByList
		{
			get
			{
				return this._orderByList;
			}
			set
			{
				this._orderByList = value;
			}
		}

		// Token: 0x170005AE RID: 1454
		// (get) Token: 0x060019D1 RID: 6609 RVA: 0x0032CB55 File Offset: 0x0032AD55
		// (set) Token: 0x060019D0 RID: 6608 RVA: 0x0032CB4C File Offset: 0x0032AD4C
		public virtual TOrderBy SortClause
		{
			get
			{
				return this._sortClause;
			}
			set
			{
				this._sortClause = value;
			}
		}

		// Token: 0x170005AF RID: 1455
		// (get) Token: 0x060019D2 RID: 6610 RVA: 0x0032CB5D File Offset: 0x0032AD5D
		// (set) Token: 0x060019D3 RID: 6611 RVA: 0x0032CB65 File Offset: 0x0032AD65
		public virtual TWindowDef WindowDef
		{
			get
			{
				return this._windowDef;
			}
			set
			{
				this._windowDef = value;
			}
		}

		// Token: 0x170005B0 RID: 1456
		// (get) Token: 0x060019D5 RID: 6613 RVA: 0x0032CB77 File Offset: 0x0032AD77
		// (set) Token: 0x060019D4 RID: 6612 RVA: 0x0032CB6E File Offset: 0x0032AD6E
		public virtual TWindowSpecification WindowSpecification
		{
			get
			{
				return this._windowSpecification;
			}
			set
			{
				this._windowSpecification = value;
			}
		}

		// Token: 0x170005B1 RID: 1457
		// (get) Token: 0x060019D7 RID: 6615 RVA: 0x0032CB88 File Offset: 0x0032AD88
		// (set) Token: 0x060019D6 RID: 6614 RVA: 0x0032CB7F File Offset: 0x0032AD7F
		public virtual TDatatypeAttribute DatatypeAttribute
		{
			get
			{
				return this._datatypeAttribute;
			}
			set
			{
				this._datatypeAttribute = value;
			}
		}

		// Token: 0x170005B2 RID: 1458
		// (get) Token: 0x060019D8 RID: 6616 RVA: 0x0032CB90 File Offset: 0x0032AD90
		// (set) Token: 0x060019D9 RID: 6617 RVA: 0x0032CB98 File Offset: 0x0032AD98
		public virtual TSourceToken Extract_time_token
		{
			get
			{
				return this.extract_time_token;
			}
			set
			{
				this.extract_time_token = value;
			}
		}

		// Token: 0x170005B3 RID: 1459
		// (get) Token: 0x060019DB RID: 6619 RVA: 0x0032CBAA File Offset: 0x0032ADAA
		// (set) Token: 0x060019DA RID: 6618 RVA: 0x0032CBA1 File Offset: 0x0032ADA1
		public virtual TDummy Dummy
		{
			get
			{
				return this.dummy;
			}
			set
			{
				this.dummy = value;
			}
		}

		// Token: 0x170005B4 RID: 1460
		// (get) Token: 0x060019DD RID: 6621 RVA: 0x0032CBBB File Offset: 0x0032ADBB
		// (set) Token: 0x060019DC RID: 6620 RVA: 0x0032CBB2 File Offset: 0x0032ADB2
		public virtual TInExpr InExpr
		{
			get
			{
				return this._inExpr;
			}
			set
			{
				this._inExpr = value;
			}
		}

		// Token: 0x170005B5 RID: 1461
		// (set) Token: 0x060019DE RID: 6622 RVA: 0x0032CBC4 File Offset: 0x0032ADC4
		public virtual TExpressionList ExtractXMLArg
		{
			set
			{
				if (value.size() > 1)
				{
					this.XMLType_Instance_Renamed = value.getExpression(0);
					this.XPath_String_Renamed = value.getExpression(1);
				}
				if (value.size() > 2)
				{
					this.Namespace_String_Renamed = value.getExpression(2);
				}
				this.functionType = EFunctionType.extractxml_t;
			}
		}

		// Token: 0x170005B6 RID: 1462
		// (get) Token: 0x060019DF RID: 6623 RVA: 0x0032CC12 File Offset: 0x0032AE12
		// (set) Token: 0x060019E0 RID: 6624 RVA: 0x0032CC1A File Offset: 0x0032AE1A
		public virtual TExpression Namespace_String
		{
			get
			{
				return this.Namespace_String_Renamed;
			}
			set
			{
				this.Namespace_String_Renamed = value;
			}
		}

		// Token: 0x170005B7 RID: 1463
		// (get) Token: 0x060019E1 RID: 6625 RVA: 0x0032CC23 File Offset: 0x0032AE23
		// (set) Token: 0x060019E2 RID: 6626 RVA: 0x0032CC2B File Offset: 0x0032AE2B
		public virtual TExpression XPath_String
		{
			get
			{
				return this.XPath_String_Renamed;
			}
			set
			{
				this.XPath_String_Renamed = value;
			}
		}

		// Token: 0x170005B8 RID: 1464
		// (get) Token: 0x060019E3 RID: 6627 RVA: 0x0032CC34 File Offset: 0x0032AE34
		// (set) Token: 0x060019E4 RID: 6628 RVA: 0x0032CC3C File Offset: 0x0032AE3C
		public virtual TExpression XMLType_Instance
		{
			get
			{
				return this.XMLType_Instance_Renamed;
			}
			set
			{
				this.XMLType_Instance_Renamed = value;
			}
		}

		// Token: 0x170005B9 RID: 1465
		// (get) Token: 0x060019E5 RID: 6629 RVA: 0x0032CC45 File Offset: 0x0032AE45
		// (set) Token: 0x060019E6 RID: 6630 RVA: 0x0032CC4D File Offset: 0x0032AE4D
		public virtual TObjectNameList MatchColumns
		{
			get
			{
				return this.matchColumns;
			}
			set
			{
				this.matchColumns = value;
			}
		}

		// Token: 0x170005BA RID: 1466
		// (get) Token: 0x060019E7 RID: 6631 RVA: 0x0032CC56 File Offset: 0x0032AE56
		// (set) Token: 0x060019E8 RID: 6632 RVA: 0x0032CC5E File Offset: 0x0032AE5E
		public virtual TExpression AgainstExpr
		{
			get
			{
				return this.againstExpr;
			}
			set
			{
				this.againstExpr = value;
			}
		}

		// Token: 0x170005BB RID: 1467
		// (get) Token: 0x060019EA RID: 6634 RVA: 0x0032CC70 File Offset: 0x0032AE70
		// (set) Token: 0x060019E9 RID: 6633 RVA: 0x0032CC67 File Offset: 0x0032AE67
		public virtual TTypeName Typename
		{
			get
			{
				return this.typename;
			}
			set
			{
				this.typename = value;
			}
		}

		// Token: 0x170005BC RID: 1468
		// (get) Token: 0x060019EB RID: 6635 RVA: 0x0032CC78 File Offset: 0x0032AE78
		// (set) Token: 0x060019EC RID: 6636 RVA: 0x0032CC80 File Offset: 0x0032AE80
		public virtual EFunctionType FunctionType
		{
			get
			{
				return this.functionType;
			}
			set
			{
				this.functionType = value;
			}
		}

		// Token: 0x170005BD RID: 1469
		// (get) Token: 0x060019ED RID: 6637 RVA: 0x0032CC89 File Offset: 0x0032AE89
		// (set) Token: 0x060019EE RID: 6638 RVA: 0x0032CC91 File Offset: 0x0032AE91
		public virtual TExpression RangeSize
		{
			get
			{
				return this.rangeSize;
			}
			set
			{
				this.rangeSize = value;
			}
		}

		// Token: 0x170005BE RID: 1470
		// (get) Token: 0x060019EF RID: 6639 RVA: 0x0032CC9A File Offset: 0x0032AE9A
		// (set) Token: 0x060019F0 RID: 6640 RVA: 0x0032CCA2 File Offset: 0x0032AEA2
		public virtual TExpression BetweenExpr
		{
			get
			{
				return this.betweenExpr;
			}
			set
			{
				this.betweenExpr = value;
			}
		}

		// Token: 0x170005BF RID: 1471
		// (get) Token: 0x060019F1 RID: 6641 RVA: 0x0032CCAB File Offset: 0x0032AEAB
		// (set) Token: 0x060019F2 RID: 6642 RVA: 0x0032CCB3 File Offset: 0x0032AEB3
		public virtual TObjectName FunctionName
		{
			get
			{
				return this.functionName;
			}
			set
			{
				this.functionName = value;
			}
		}

		// Token: 0x170005C0 RID: 1472
		// (get) Token: 0x060019F4 RID: 6644 RVA: 0x0032CCC5 File Offset: 0x0032AEC5
		// (set) Token: 0x060019F3 RID: 6643 RVA: 0x0032CCBC File Offset: 0x0032AEBC
		public virtual TTrimArgument TrimArgument
		{
			get
			{
				return this.trimArgument;
			}
			set
			{
				this.trimArgument = value;
			}
		}

		// Token: 0x170005C1 RID: 1473
		// (get) Token: 0x060019F6 RID: 6646 RVA: 0x0032CCD6 File Offset: 0x0032AED6
		// (set) Token: 0x060019F5 RID: 6645 RVA: 0x0032CCCD File Offset: 0x0032AECD
		public virtual TExpression Expr1
		{
			get
			{
				return this.expr1;
			}
			set
			{
				this.expr1 = value;
			}
		}

		// Token: 0x170005C2 RID: 1474
		// (get) Token: 0x060019F8 RID: 6648 RVA: 0x0032CCE7 File Offset: 0x0032AEE7
		// (set) Token: 0x060019F7 RID: 6647 RVA: 0x0032CCDE File Offset: 0x0032AEDE
		public virtual TExpression Expr2
		{
			get
			{
				return this.expr2;
			}
			set
			{
				this.expr2 = value;
			}
		}

		// Token: 0x170005C3 RID: 1475
		// (get) Token: 0x060019FA RID: 6650 RVA: 0x0032CCF8 File Offset: 0x0032AEF8
		// (set) Token: 0x060019F9 RID: 6649 RVA: 0x0032CCEF File Offset: 0x0032AEEF
		public virtual TTypeName AsDatatype
		{
			get
			{
				return this.asDatatype;
			}
			set
			{
				this.asDatatype = value;
			}
		}

		// Token: 0x170005C4 RID: 1476
		// (get) Token: 0x060019FC RID: 6652 RVA: 0x0032CD09 File Offset: 0x0032AF09
		// (set) Token: 0x060019FB RID: 6651 RVA: 0x0032CD00 File Offset: 0x0032AF00
		public virtual TResultColumnList XMLForestValueList
		{
			get
			{
				return this.XMLForestValueList_Renamed;
			}
			set
			{
				this.XMLForestValueList_Renamed = value;
			}
		}

		// Token: 0x170005C5 RID: 1477
		// (get) Token: 0x060019FE RID: 6654 RVA: 0x0032CD1A File Offset: 0x0032AF1A
		// (set) Token: 0x060019FD RID: 6653 RVA: 0x0032CD11 File Offset: 0x0032AF11
		public virtual TExpression XMLElementNameExpr
		{
			get
			{
				return this.XMLElementNameExpr_Renamed;
			}
			set
			{
				this.XMLElementNameExpr_Renamed = value;
			}
		}

		// Token: 0x170005C6 RID: 1478
		// (get) Token: 0x06001A00 RID: 6656 RVA: 0x0032CD2B File Offset: 0x0032AF2B
		// (set) Token: 0x060019FF RID: 6655 RVA: 0x0032CD22 File Offset: 0x0032AF22
		public virtual TXMLAttributesClause XMLAttributesClause
		{
			get
			{
				return this.XMLAttributesClause_Renamed;
			}
			set
			{
				this.XMLAttributesClause_Renamed = value;
			}
		}

		// Token: 0x170005C7 RID: 1479
		// (get) Token: 0x06001A02 RID: 6658 RVA: 0x0032CD3C File Offset: 0x0032AF3C
		// (set) Token: 0x06001A01 RID: 6657 RVA: 0x0032CD33 File Offset: 0x0032AF33
		public virtual TResultColumnList XMLElementValueExprList
		{
			get
			{
				return this.XMLElementValueExprList_Renamed;
			}
			set
			{
				this.XMLElementValueExprList_Renamed = value;
			}
		}

		// Token: 0x170005C8 RID: 1480
		// (get) Token: 0x06001A04 RID: 6660 RVA: 0x0032CD4D File Offset: 0x0032AF4D
		// (set) Token: 0x06001A03 RID: 6659 RVA: 0x0032CD44 File Offset: 0x0032AF44
		public virtual TExpression Expr3
		{
			get
			{
				return this.expr3;
			}
			set
			{
				this.expr3 = value;
			}
		}

		// Token: 0x170005C9 RID: 1481
		// (get) Token: 0x06001A06 RID: 6662 RVA: 0x0032CD5E File Offset: 0x0032AF5E
		// (set) Token: 0x06001A05 RID: 6661 RVA: 0x0032CD55 File Offset: 0x0032AF55
		public virtual TExpressionList ExprList
		{
			get
			{
				return this.exprList;
			}
			set
			{
				this.exprList = value;
			}
		}

		// Token: 0x170005CA RID: 1482
		// (get) Token: 0x06001A08 RID: 6664 RVA: 0x0032CD6F File Offset: 0x0032AF6F
		// (set) Token: 0x06001A07 RID: 6663 RVA: 0x0032CD66 File Offset: 0x0032AF66
		public virtual TExpressionList Args
		{
			get
			{
				return this._arguments;
			}
			set
			{
				this._arguments = value;
			}
		}

		// Token: 0x06001A09 RID: 6665 RVA: 0x0032CD77 File Offset: 0x0032AF77
		public override void init(object arg1)
		{
			this.functionName = (TObjectName)arg1;
			this.functionName.ObjectType = 13;
		}

		// Token: 0x06001A0A RID: 6666 RVA: 0x0032CD92 File Offset: 0x0032AF92
		public override void init(object arg1, object arg2)
		{
			this.functionType = (EFunctionType)arg1;
			this.init(arg2);
		}

		// Token: 0x170005CB RID: 1483
		// (get) Token: 0x06001A0C RID: 6668 RVA: 0x0032CDB0 File Offset: 0x0032AFB0
		// (set) Token: 0x06001A0B RID: 6667 RVA: 0x0032CDA7 File Offset: 0x0032AFA7
		public virtual TAnalyticFunction AnalyticFunction
		{
			get
			{
				return this._analyticFunction;
			}
			set
			{
				this._analyticFunction = value;
			}
		}

		// Token: 0x06001A0D RID: 6669 RVA: 0x0032CDB8 File Offset: 0x0032AFB8
		public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)
		{
			psql.DatabaseObjects.Add(this.functionName);
			switch (this.functionType)
			{
			case EFunctionType.unknown_t:
			case EFunctionType.udf_t:
			case EFunctionType.chr_t:
				if (this._callTarget != null)
				{
					this._callTarget.doParse(psql, plocation);
				}
				if (this._arguments != null)
				{
					bool flag = true;
					if (psql.dbvendor == EDbVendor.dbvsybase || psql.dbvendor == EDbVendor.dbvmssql)
					{
						flag = (!this.functionName.ToString().Equals("dateadd", StringComparison.CurrentCultureIgnoreCase) && !this.functionName.ToString().Equals("datediff", StringComparison.CurrentCultureIgnoreCase) && !this.functionName.ToString().Equals("datename", StringComparison.CurrentCultureIgnoreCase) && !this.functionName.ToString().Equals("datepart", StringComparison.CurrentCultureIgnoreCase));
					}
					for (int i = 0; i < this._arguments.size(); i++)
					{
						if (flag || i != 0)
						{
							this._arguments.getExpression(i).doParse(psql, plocation);
						}
					}
				}
				if (psql.dbvendor == EDbVendor.dbvmssql && (this.isSQLServerOGCMethod(this.functionName.ObjectToken) || this.isSQLServerFunctionsONXMLColumn(this.functionName.ObjectToken)) && this.functionName.SchemaToken != null)
				{
					this.functionName.SchemaToken.DbObjType = EDbObjectType.column;
					if (this.functionName.DatabaseToken != null)
					{
						this.functionName.DatabaseToken.DbObjType = EDbObjectType.table;
					}
					TObjectName tobjectName = new TObjectName();
					tobjectName.init(this.functionName.DatabaseToken, this.functionName.SchemaToken);
					tobjectName.GSharpSqlParser = psql.GSharpSqlParser;
					psql.linkColumnReferenceToTable(tobjectName, plocation);
					psql.linkColumnToTable(tobjectName, plocation);
				}
				break;
			case EFunctionType.trim_t:
				if (this.trimArgument != null)
				{
					this.trimArgument.doParse(psql, plocation);
				}
				break;
			case EFunctionType.cast_t:
				this.expr1.doParse(psql, plocation);
				break;
			case EFunctionType.convert_t:
				if (this.Typename != null)
				{
					this.Typename.doParse(psql, plocation);
				}
				this.Parameter.doParse(psql, plocation);
				if (this.Style != null)
				{
					this.Style.doParse(psql, plocation);
				}
				break;
			case EFunctionType.extract_t:
				if (this.expr1 != null)
				{
					this.expr1.doParse(psql, plocation);
				}
				break;
			case EFunctionType.treat_t:
				this.expr1.doParse(psql, plocation);
				break;
			case EFunctionType.contains_t:
				this.expr1.doParse(psql, plocation);
				this.expr2.doParse(psql, plocation);
				break;
			case EFunctionType.freetext_t:
				this.expr1.doParse(psql, plocation);
				this.expr2.doParse(psql, plocation);
				break;
			case EFunctionType.position_t:
				this.expr1.doParse(psql, plocation);
				this.expr2.doParse(psql, plocation);
				break;
			case EFunctionType.translate_t:
				this.expr1.doParse(psql, plocation);
				if (this.expr2 != null)
				{
					this.expr2.doParse(psql, plocation);
				}
				if (this.expr3 != null)
				{
					this.expr3.doParse(psql, plocation);
				}
				break;
			case EFunctionType.substring_t:
				if (this._arguments != null)
				{
					for (int j = 0; j < this._arguments.size(); j++)
					{
						this._arguments.getExpression(j).doParse(psql, plocation);
					}
				}
				if (this.expr1 != null)
				{
					this.expr1.doParse(psql, plocation);
				}
				if (this.expr2 != null)
				{
					this.expr2.doParse(psql, plocation);
				}
				if (this.expr3 != null)
				{
					this.expr3.doParse(psql, plocation);
				}
				break;
			case EFunctionType.adddate_t:
			case EFunctionType.date_add_t:
			case EFunctionType.subdate_t:
			case EFunctionType.date_sub_t:
			case EFunctionType.timestampadd_t:
			case EFunctionType.timestampdiff_t:
				this.expr1.doParse(psql, plocation);
				this.expr2.doParse(psql, plocation);
				break;
			case EFunctionType.group_concat_t:
				this._groupConcatParam.doParse(psql, plocation);
				break;
			case EFunctionType.match_against_t:
				for (int k = 0; k < this.MatchColumns.size(); k++)
				{
					psql.linkColumnReferenceToTable(this.MatchColumns.getObjectName(k), plocation);
					psql.linkColumnToTable(this.MatchColumns.getObjectName(k), plocation);
				}
				this.AgainstExpr.doParse(psql, plocation);
				break;
			case EFunctionType.case_n_t:
				this.Args.doParse(psql, plocation);
				break;
			case EFunctionType.range_n_t:
				this.betweenExpr.doParse(psql, plocation);
				if (this.exprList != null)
				{
					this.exprList.doParse(psql, plocation);
				}
				if (this.rangeSize != null)
				{
					this.rangeSize.doParse(psql, plocation);
				}
				break;
			case EFunctionType.xmlserialize_t:
			case EFunctionType.xmlroot_t:
				this.expr1.doParse(psql, plocation);
				break;
			case EFunctionType.xmlelement_t:
				this.XMLElementNameExpr_Renamed.doParse(psql, plocation);
				if (this.XMLAttributesClause_Renamed != null)
				{
					this.XMLAttributesClause_Renamed.doParse(psql, plocation);
				}
				if (this.XMLElementValueExprList_Renamed != null)
				{
					this.XMLElementValueExprList_Renamed.doParse(psql, plocation);
				}
				break;
			case EFunctionType.xmlforest_t:
				this.XMLForestValueList_Renamed.doParse(psql, plocation);
				break;
			}
			if (this._analyticFunction != null)
			{
				this._analyticFunction.doParse(psql, plocation);
			}
			if (this._windowDef != null)
			{
				this._windowDef.doParse(psql, plocation);
			}
		}

		// Token: 0x06001A0E RID: 6670 RVA: 0x0032D31A File Offset: 0x0032B51A
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06001A0F RID: 6671 RVA: 0x0032D32C File Offset: 0x0032B52C
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			switch (this.functionType)
			{
			case EFunctionType.unknown_t:
				if (this._arguments != null)
				{
					this._arguments.acceptChildren(v);
				}
				break;
			case EFunctionType.udf_t:
				if (this._arguments != null)
				{
					this._arguments.acceptChildren(v);
				}
				if (this._analyticFunction != null)
				{
					this._analyticFunction.acceptChildren(v);
				}
				break;
			case EFunctionType.trim_t:
				if (this.trimArgument != null)
				{
					this.trimArgument.acceptChildren(v);
				}
				break;
			case EFunctionType.cast_t:
				this.expr1.acceptChildren(v);
				break;
			case EFunctionType.convert_t:
				if (this.typename != null)
				{
					this.Typename.acceptChildren(v);
				}
				this.Parameter.acceptChildren(v);
				if (this.Style != null)
				{
					this.Style.acceptChildren(v);
				}
				break;
			case EFunctionType.extract_t:
				if (this.expr1 != null)
				{
					this.expr1.acceptChildren(v);
				}
				break;
			case EFunctionType.treat_t:
				this.expr1.acceptChildren(v);
				break;
			case EFunctionType.contains_t:
				this.expr1.acceptChildren(v);
				this.expr2.acceptChildren(v);
				break;
			case EFunctionType.freetext_t:
				this.expr1.acceptChildren(v);
				this.expr2.acceptChildren(v);
				break;
			case EFunctionType.position_t:
				this.expr1.acceptChildren(v);
				this.expr2.acceptChildren(v);
				break;
			case EFunctionType.substring_t:
				if (this._arguments != null)
				{
					this._arguments.acceptChildren(v);
				}
				if (this.expr1 != null)
				{
					this.expr1.acceptChildren(v);
				}
				if (this.expr2 != null)
				{
					this.expr2.acceptChildren(v);
				}
				if (this.expr3 != null)
				{
					this.expr3.acceptChildren(v);
				}
				break;
			case EFunctionType.adddate_t:
			case EFunctionType.date_add_t:
			case EFunctionType.subdate_t:
			case EFunctionType.date_sub_t:
			case EFunctionType.timestampadd_t:
			case EFunctionType.timestampdiff_t:
				this.expr1.acceptChildren(v);
				this.expr2.acceptChildren(v);
				break;
			case EFunctionType.match_against_t:
				this.AgainstExpr.acceptChildren(v);
				break;
			case EFunctionType.case_n_t:
				this.Args.acceptChildren(v);
				break;
			case EFunctionType.range_n_t:
				this.betweenExpr.acceptChildren(v);
				if (this.exprList != null)
				{
					this.exprList.acceptChildren(v);
				}
				if (this.rangeSize != null)
				{
					this.rangeSize.acceptChildren(v);
				}
				break;
			}
			v.postVisit(this);
		}

		// Token: 0x06001A10 RID: 6672 RVA: 0x0032D5DC File Offset: 0x0032B7DC
		private bool isSQLServerFunctionsONXMLColumn(TSourceToken st)
		{
			return st.tokencode == 556 || st.tokencode == 555 || st.tokencode == 554 || st.tokencode == 557 || st.tokencode == 553;
		}

		// Token: 0x06001A11 RID: 6673 RVA: 0x0032D62C File Offset: 0x0032B82C
		private bool isSQLServerOGCMethod(TSourceToken st)
		{
			return st.tokencode == 532 || st.tokencode == 533 || st.tokencode == 534 || st.tokencode == 535 || st.tokencode == 536 || st.tokencode == 537 || st.tokencode == 538 || st.tokencode == 539 || st.tokencode == 540 || st.tokencode == 541 || st.tokencode == 542 || st.tokencode == 543 || st.tokencode == 544 || st.tokencode == 545 || st.tokencode == 546 || st.tokencode == 547 || st.tokencode == 548 || st.tokencode == 549 || st.tokencode == 550 || st.tokencode == 551 || st.tokencode == 552;
		}

		// Token: 0x170005CC RID: 1484
		// (get) Token: 0x06001A13 RID: 6675 RVA: 0x0032D776 File Offset: 0x0032B976
		// (set) Token: 0x06001A12 RID: 6674 RVA: 0x0032D76D File Offset: 0x0032B96D
		public virtual int FuncType
		{
			get
			{
				return this.funcType;
			}
			set
			{
				this.funcType = value;
			}
		}

		// Token: 0x170005CD RID: 1485
		// (set) Token: 0x06001A14 RID: 6676 RVA: 0x0032D77E File Offset: 0x0032B97E
		public virtual bool CheckedBuiltIn
		{
			set
			{
				this.isCheckedBuiltIn = value;
			}
		}

		// Token: 0x170005CE RID: 1486
		// (set) Token: 0x06001A15 RID: 6677 RVA: 0x0032D787 File Offset: 0x0032B987
		public virtual bool BuiltIn
		{
			set
			{
				this._isBuiltIn_Renamed = value;
			}
		}

		// Token: 0x170005CF RID: 1487
		// (set) Token: 0x06001A16 RID: 6678 RVA: 0x0032D790 File Offset: 0x0032B990
		public virtual TExpression Trim_Expr
		{
			set
			{
				this.Trim_Expr_Renamed = value;
			}
		}

		// Token: 0x170005D0 RID: 1488
		// (set) Token: 0x06001A17 RID: 6679 RVA: 0x0032D799 File Offset: 0x0032B999
		public virtual TExpression Trim_From_Expr
		{
			set
			{
				this.Trim_From_Expr_Renamed = value;
			}
		}

		// Token: 0x04001944 RID: 6468
		private TExpression _castOperand;

		// Token: 0x04001945 RID: 6469
		private TExpression _stringExpr;

		// Token: 0x04001946 RID: 6470
		private TExpression _separatorExpr;

		// Token: 0x04001947 RID: 6471
		private TExpression _parameter;

		// Token: 0x04001948 RID: 6472
		private TExpression _style;

		// Token: 0x04001949 RID: 6473
		private TExpressionCallTarget _callTarget;

		// Token: 0x0400194A RID: 6474
		private TGroupConcatParam _groupConcatParam;

		// Token: 0x0400194B RID: 6475
		private bool isCheckedBuiltIn;

		// Token: 0x0400194C RID: 6476
		private bool _isBuiltIn_Renamed;

		// Token: 0x0400194D RID: 6477
		private TXMLPassingClause _passingClause;

		// Token: 0x0400194E RID: 6478
		private EAggregateType _aggregateType;

		// Token: 0x0400194F RID: 6479
		private TOrderByItemList _orderByList;

		// Token: 0x04001950 RID: 6480
		private TOrderBy _sortClause;

		// Token: 0x04001951 RID: 6481
		private TWindowDef _windowDef;

		// Token: 0x04001952 RID: 6482
		private TWindowSpecification _windowSpecification;

		// Token: 0x04001953 RID: 6483
		private TDatatypeAttribute _datatypeAttribute;

		// Token: 0x04001954 RID: 6484
		private TDummy dummy;

		// Token: 0x04001955 RID: 6485
		private TInExpr _inExpr;

		// Token: 0x04001956 RID: 6486
		private TExpression XMLType_Instance_Renamed;

		// Token: 0x04001957 RID: 6487
		private TExpression XPath_String_Renamed;

		// Token: 0x04001958 RID: 6488
		private TExpression Namespace_String_Renamed;

		// Token: 0x04001959 RID: 6489
		private TObjectNameList matchColumns;

		// Token: 0x0400195A RID: 6490
		private TExpression againstExpr;

		// Token: 0x0400195B RID: 6491
		private TTypeName typename;

		// Token: 0x0400195C RID: 6492
		private TSourceToken extract_time_token;

		// Token: 0x0400195D RID: 6493
		private TExpression expr1;

		// Token: 0x0400195E RID: 6494
		private TExpression expr2;

		// Token: 0x0400195F RID: 6495
		private TExpression expr3;

		// Token: 0x04001960 RID: 6496
		private EFunctionType functionType = EFunctionType.udf_t;

		// Token: 0x04001961 RID: 6497
		private TExpression betweenExpr;

		// Token: 0x04001962 RID: 6498
		private TExpression rangeSize;

		// Token: 0x04001963 RID: 6499
		private TObjectName functionName;

		// Token: 0x04001964 RID: 6500
		public TExpression Trim_Expr_Renamed;

		// Token: 0x04001965 RID: 6501
		public TExpression Trim_From_Expr_Renamed;

		// Token: 0x04001966 RID: 6502
		private TTrimArgument trimArgument;

		// Token: 0x04001967 RID: 6503
		private TTypeName asDatatype;

		// Token: 0x04001968 RID: 6504
		private TResultColumnList XMLForestValueList_Renamed;

		// Token: 0x04001969 RID: 6505
		private TExpression XMLElementNameExpr_Renamed;

		// Token: 0x0400196A RID: 6506
		private TXMLAttributesClause XMLAttributesClause_Renamed;

		// Token: 0x0400196B RID: 6507
		private TResultColumnList XMLElementValueExprList_Renamed;

		// Token: 0x0400196C RID: 6508
		private TExpressionList exprList;

		// Token: 0x0400196D RID: 6509
		private TExpressionList _arguments;

		// Token: 0x0400196E RID: 6510
		private TAnalyticFunction _analyticFunction;

		// Token: 0x0400196F RID: 6511
		private int funcType;

		// Token: 0x04001970 RID: 6512
		public const int fntUdf = 0;

		// Token: 0x04001971 RID: 6513
		public const int fntTrim = 1;

		// Token: 0x04001972 RID: 6514
		public const int fntCast = 2;

		// Token: 0x04001973 RID: 6515
		public const int fntConvert = 3;

		// Token: 0x04001974 RID: 6516
		public const int fntExtract = 4;

		// Token: 0x04001975 RID: 6517
		public const int fntTreat = 5;

		// Token: 0x04001976 RID: 6518
		public const int fntContains = 6;

		// Token: 0x04001977 RID: 6519
		public const int fntFreetext = 7;

		// Token: 0x04001978 RID: 6520
		public const int fntCaseN = 10;

		// Token: 0x04001979 RID: 6521
		public const int fntRangeN = 11;

		// Token: 0x0400197A RID: 6522
		public const int fntPosition = 12;

		// Token: 0x0400197B RID: 6523
		public const int fntTranslate = 14;

		// Token: 0x0400197C RID: 6524
		public const int fntTranslateCHK = 15;

		// Token: 0x0400197D RID: 6525
		public const int fntCSUM = 16;

		// Token: 0x0400197E RID: 6526
		public const int fntRank = 17;

		// Token: 0x0400197F RID: 6527
		public const int fntXmlQuery = 18;

		// Token: 0x04001980 RID: 6528
		public const int fntSubString = 31;

		// Token: 0x04001981 RID: 6529
		public const int fntAddDate = 32;

		// Token: 0x04001982 RID: 6530
		public const int fntDateAdd = 33;

		// Token: 0x04001983 RID: 6531
		public const int fntSubDate = 34;

		// Token: 0x04001984 RID: 6532
		public const int fntDateSub = 35;

		// Token: 0x04001985 RID: 6533
		public const int fntTimestampAdd = 36;

		// Token: 0x04001986 RID: 6534
		public const int fntTimestampDiff = 37;

		// Token: 0x04001987 RID: 6535
		public const int fntGroupConcat = 38;

		// Token: 0x04001988 RID: 6536
		public const int fntMatchAgainst = 39;

		// Token: 0x04001989 RID: 6537
		public const int fntExtractXML = 50;

		// Token: 0x0400198A RID: 6538
		public const int fntOGC = 60;
	}
}
